package com.example.demo.service;

import com.example.demo.dto.CommodityDTO;
import com.example.demo.exception.CommodityNotFoundException;
import com.example.demo.exception.StockDeductionException;
import com.example.demo.exception.ZeroStockException;
import com.example.demo.mapper.entity.Commodity;
import com.example.demo.mapper.entity.ExchangeRecord;
import com.example.demo.mapper.entity.StudentPoints;
import com.example.demo.utils.PageBo;
import com.example.demo.utils.PageVo;

import java.util.List;

/**
 * @author Lucy
 * @create 2024-02-13 16:04
 */
public interface StudentPointsService {
    void insertStudentPoints(StudentPoints points);

    StudentPoints selectStudentPointsByStudentId(int studentId);

    PageVo<CommodityDTO> getCommoditiesList(PageBo pageBo, int type);

    PageVo<CommodityDTO> getCommoditiesList(PageBo pageBo, int type, int gender);

    PageVo<CommodityDTO> getCouponsList(PageBo pageBo, int type);

    Commodity selectCommodityById(int commodityId);

    void updateCommodityStock(Commodity commodity) throws StockDeductionException, ZeroStockException, CommodityNotFoundException;

    void updateStudentPoints(int studentId, int earnedPoints, int spentPoints);

    void insertExchangeRecord(ExchangeRecord exchangeRecord);

    List<StudentPoints> selectStudentPointsList();
}
